Ext.define('cfWeb.store.serviceAudit.ServiceAuditStore', {
    extend: 'Ext.data.Store',
    alias: 'widget.serviceAuditStore',
    autoLoad: true,
    autoSync: true,
    fields: [
        { name: 'id', type: 'string' },
        { name: 'serviceInstanceName', type: 'string' },
        { name: 'service', type: 'string' },
        { name: 'plan', type: 'string' },
        { name: 'org', type: 'string' },
        { name: 'space', type: 'string' },
        { name: 'serviceTypeId', type: 'string' },
        { name: 'createTime', type: 'string' },
        {
            name: 'createTime', type: 'string',
            convert: function (v) {
                var now = new Date(v);
                return now.toLocaleString();
            }
        },
        {
            name: 'updateTime', type: 'string',
            convert: function (v) {
                var now = new Date(v);
                return now.toLocaleString();
            }
        },
        { name: 'state', type: 'int' },
        { name: 'host', type: 'string' },
        { name: 'port', type: 'string' },
        { name: 'user', type: 'string' },
        { name: 'planId', type: 'string' }
    ],
    groupField: 'state',
    proxy: {
        type: 'rest',
        url: 'rest/serviceaudit/listServiceOfAudit',
        reader: {
            type: 'json',
            root: 'data',
            successProperty : 'success'
        }
    }
});
